home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 June: Reference Library / Dev.CD Jun 95 / Dev.CD Jun 95.toast / Technical Documentation / PCI Information / PCI Developer’s Kit (disk) / Expansion Manager / DisplayDeviceTree / ExpansionBus.h < prev   
Encoding:
C/C++ Source or Header  |  1994-06-27  |  4.4 KB  |  159 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        ExpansionBus.h
  3.  
  4.     Contains:    Expansion Mgr Device Tree Manipulation Routines
  5.  
  6.     Written by:    Al Kossow
  7.  
  8.     Copyright:    © 1993-1994 by Apple Computer, Inc., all rights reserved.
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <1>     3/31/94    fau        first checked in
  13. */
  14.  
  15. #pragma once
  16. #ifndef __EXPANSIONBUS__
  17. #define __EXPANSIONBUS__
  18.  
  19. #ifndef __TYPES__
  20. #include "Types.h"
  21. #endif
  22.  
  23. // for sIntQElemPtr
  24. #ifndef __OSUTILS__
  25. #include <OSUtils.h>
  26. #endif
  27.  
  28. #define kTypeMask                  0x03        
  29. #define    kDeviceNode                 0x01
  30. #define kPropertyNode             0x02
  31.  
  32. #define kNullAttribute                0
  33. #define kAttributeMask             0x70
  34. #define    kAttributeLocked         0x10
  35. #define kAttributeNVRAM             0x20
  36. #define    kAttributeSystem         0x40
  37.  
  38. #define kAttributeROMProperty     0x80
  39. #define kAttributeDeferred        0x100
  40.  
  41. /*
  42.  * The device tree types
  43.  */
  44.  
  45. typedef void *DeviceTreeNodeID;
  46. typedef DeviceTreeNodeID DeviceNodeID;
  47. typedef DeviceTreeNodeID DevicePropertyID;
  48.  
  49. /*
  50.  * The device tree info structures
  51.  */
  52.  
  53. typedef struct DeviceNodeInfo {
  54.         unsigned long        nodeAttributes;        // attributes of this node
  55.         DeviceNodeID        parentNode;            // cannot be nil, except for the root
  56.         DeviceNodeID        peerNode;            // nil if no peers
  57.         DeviceNodeID        childNode;
  58.         DevicePropertyID    propertyNode;
  59.         char                name[32];            // name of this node
  60. } DeviceNodeInfo;
  61.  
  62. typedef struct DevicePropertyInfo {
  63.         unsigned long        nodeAttributes;        // attributes of this node
  64.         DeviceNodeID        parentNode;            // cannot be nil
  65.         DevicePropertyID    peerNode;            // nil if no peers
  66.         unsigned long        propertySize;        // size of property
  67.         char                name[32];            // name of this node
  68. } DevicePropertyInfo;
  69.  
  70. #ifndef _ExpansionBusDispatch
  71. #define _ExpansionBusDispatch 0xAAF3
  72. #endif
  73.  
  74. /*
  75.  * Expansion Manager C Interface
  76.  *
  77.  */
  78.  
  79. #ifdef __cplusplus
  80. extern "C" {
  81. #endif
  82.  
  83. //    Selectors are in D0.W, with the low byte containing the actual selector
  84. //    and the high byte containing the number of words of parameters on the
  85. //    stack.
  86.  
  87. OSErr DeviceTreeRoot (DeviceNodeID *rootNode)
  88.     = { 0x303c, 0x0204, _ExpansionBusDispatch};
  89.  
  90. OSErr DeviceTreeDeviceInfo (DeviceNodeID nodeID, DeviceNodeInfo *nodeInfo)
  91.     = { 0x303c, 0x0405, _ExpansionBusDispatch};
  92.  
  93. OSErr DeviceTreePropertyInfo (DevicePropertyID nodeID, DevicePropertyInfo *nodeInfo)
  94.     = { 0x303c, 0x0406, _ExpansionBusDispatch};
  95.  
  96. OSErr DeviceTreePeerCount (DeviceNodeID nodeID, unsigned long *count)
  97.     = { 0x303c, 0x040D, _ExpansionBusDispatch};
  98.  
  99. OSErr DeviceTreePropertyCount (DeviceNodeID nodeID, unsigned long *count)
  100.     = { 0x303c, 0x040E, _ExpansionBusDispatch};
  101.  
  102. OSErr DeviceTreeSearch (DeviceNodeID *startNodeID, Byte *targetProperty,
  103.                         Byte *propertyValue, Boolean restartSearch)
  104.     = { 0x303c, 0x0707, _ExpansionBusDispatch};
  105.  
  106. OSErr DeviceTreeNodeSearch (DeviceNodeID nodeID, Byte *targetProperty,
  107.                             Byte *propertyData, unsigned long maxSize,
  108.                             unsigned long *actualSize)
  109.     = { 0x303c, 0x0A08, _ExpansionBusDispatch};
  110.  
  111. OSErr DeviceTreeAddDevice (DeviceNodeID parentNodeID, unsigned long attributes,
  112.                            Byte *name, DeviceNodeID *newNode)
  113.     = { 0x303c, 0x0809, _ExpansionBusDispatch};
  114.  
  115. OSErr DeviceTreeDeleteDevice (DeviceNodeID nodeID)
  116.     = { 0x303c, 0x020A, _ExpansionBusDispatch};
  117.  
  118. OSErr DeviceTreeAddProperty (DeviceNodeID parentNodeID, unsigned long attributes,
  119.                              Byte *name, DevicePropertyID *newNode)
  120.     = { 0x303c, 0x080B, _ExpansionBusDispatch};
  121.  
  122. OSErr DeviceTreeDeleteProperty (DevicePropertyID nodeID)
  123.     = { 0x303c, 0x020C, _ExpansionBusDispatch};
  124.  
  125. OSErr DeviceTreeSetProperty (DevicePropertyID nodeID, Byte *userData,
  126.                              unsigned long size)
  127.     = { 0x303c, 0x060F, _ExpansionBusDispatch};
  128.  
  129. OSErr DeviceTreeGetProperty (DevicePropertyID nodeID, Byte *userData,
  130.                              unsigned long size)
  131.     = { 0x303c, 0x0610, _ExpansionBusDispatch};
  132.  
  133. OSErr ExpMgrRegisterBridge (DeviceNodeID nodeID)
  134.     = { 0x303c, 0x0211, _ExpansionBusDispatch};
  135.  
  136. OSErr ExpMgrEnableBridge (DeviceNodeID nodeID)
  137.     = { 0x303c, 0x0212, _ExpansionBusDispatch};
  138.  
  139. OSErr ExpMgrDisableBridge (DeviceNodeID nodeID)
  140.     = { 0x303c, 0x0213, _ExpansionBusDispatch};
  141.  
  142. OSErr ExpMgrInstallISR (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
  143.     = { 0x303c, 0x0400, _ExpansionBusDispatch};
  144.  
  145. OSErr ExpMgrRemoveISR (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
  146.     = { 0x303c, 0x0401, _ExpansionBusDispatch};
  147.  
  148. OSErr ExpMgrInstallVBL (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
  149.     = { 0x303c, 0x0402, _ExpansionBusDispatch};
  150.  
  151. OSErr ExpMgrRemoveVBL (QElemPtr sIntQElemPtr, DeviceNodeID nodeID)
  152.     = { 0x303c, 0x0403, _ExpansionBusDispatch};
  153.  
  154. #ifdef __cplusplus
  155. }
  156. #endif
  157.  
  158. #endif
  159.